/**
 * @file	
 * @author	chipsea
 * @brief	Global error definition
 * @version	0.1
 * @date	2020-11-30
 * @copyright Copyright (c) 2020, CHIPSEA Co., Ltd.
 * @note
 */


#ifndef _ERROR_H
#define _ERROR_H

typedef enum {
	ERR_NONE                = 0,  /*Success*/
	ERR_FATAL               = 1,  /*unrecoverable error*/
	ERR_INTERNAL            = 2,  /*Internal Error*/
	ERR_NO_MEM              = 3,  /*No Memory for operation*/
	ERR_NOT_FOUND           = 4,  /*Not found*/
	ERR_NOT_SUPPORTED       = 5,  /*Not supported*/
	ERR_INVALID_PARAM       = 6,  /*Invalid Parameter*/
	ERR_INVALID_STATE       = 7,  /*Invalid state, operation disallowed in this state*/
	ERR_INVALID_LENGTH      = 8,  /*Invalid Length*/
	ERR_INVALID_FLAGS       = 9,  /*Invalid Flags*/
	ERR_INVALID_DATA        = 10, /*Invalid Data*/
	ERR_DATA_SIZE           = 11, /*Data size exceeds limit*/
	ERR_DATA_ALIGN          = 12, /*Data alignment is not correct*/
	ERR_TIMEOUT             = 13, /*Operation timed out*/
	ERR_NULL                = 14, /*Null Pointer*/
	ERR_FORBIDDEN           = 15, /*Forbidden Operation*/
	ERR_INVALID_ADDR        = 16, /*Bad Memory Address*/
	ERR_BUSY                = 17, /*Busy*/
	ERR_NOT_REGISTED        = 18, /*not registed*/
	ERR_IO_CONFILCT         = 19, /*IO config error*/
	ERR_IO_FAIL             = 20, /*IO fail error*/
	ERR_NOT_IMPLEMENTED     = 22, /*Function is not provide now*/
	ERR_SPI_FLASH           = 23, /*spi falsh operation erro*/
	ERR_UNINITIALIZED       = 24,
	ERR_FS_WRITE_FAILED     = 31,
	ERR_FS_CONTEXT     		= 32,
	ERR_FS_FULL             = 33,
	ERR_FS_PARAMETER   		= 34,
	ERR_FS_NOT_ENOUGH_SIZE  = 35,
	ERR_FS_EXIST_SAME_ID    = 36,
	ERR_FS_NOT_FIND_ID      = 37,
	ERR_FS_BUFFER_TOO_SMALL = 38,
	ERR_FS_UNINITIALIZED    = 39,
	ERR_FS_HAVE_INITED      = 40,
	ERR_FS_IN_INT           = 41,
	ERR_FS_RESERVED_ERROR   = 42,
	ERR_VERSION             = 43,
	ERR_NO_DEV              = 44,
	ERR_SECURE_CRYPTO       = 50,
	ERR_ACCESS_REJECTED     = 51,
	ERR_BLE_NOT_READY       = 80,  /*BLE not ready error*/
	ERR_BLE_BUSY            = 81,  /*BLE operation failed becuase of busy*/
	ERR_BLE_FAIL            = 82,  /*BLE operation failed*/
	ERR_OTA_INVALID_STATE   = 100, /*state machine error when OTA*/
	ERR_OTA_DATA_SIZE       = 101, /*data size is not correct*/
	ERR_OTA_CRC             = 102, /*bad checksum*/
	ERR_OTA_NO_APP          = 103, /*No application data*/
	ERR_OTA_BAD_DATA        = 104, /*bad application data*/
	ERR_OTA_UNKNOW_CMD      = 105, /*unknow command*/
	ERR_OTA_CRYPTO          = 106, /*crypto verify error*/
	ERR_KEY_VERIFY          = 107, /*security boot key verify fail*/
	ERR_DOUBLE_CONFIRM      = 108, /*security boot double key verify fail*/
	ERR_OTA_MIC             = 109  /*bad checksum(mic)*/
}ErrCode_t;
#endif

